package cn.itsource.service.impl;

import cn.itsource.bean.UserAddress;
import cn.itsource.mapper.UserAddressMapper;
import cn.itsource.service.IUserAddressService;
import cn.itsource.util.JsonResult;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author : 张金铭
 * @description :
 * @create :2022-11-26 09:54:00
 */
@Service
public class UserAddressServiceImpl extends ServiceImpl<UserAddressMapper, UserAddress> implements IUserAddressService {
    @Override
    public JsonResult getByUid(Long id) {

        LambdaQueryWrapper<UserAddress> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(UserAddress::getUserId,id);
        List<UserAddress> list = this.list(queryWrapper);
        return JsonResult.success(list);
    }
}
